﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:tc="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:System="clr-namespace:System;assembly=mscorlib" x:Class="ScrumBoard.HeaderControl"
    mc:Ignorable="d" Foreground="#4b5657" IsTabStop="True"
    d:DesignHeight="70" d:DesignWidth="500">
    
	<UserControl.Resources>
	

	
		<Style x:Key="ExpanderStyle1" TargetType="tc:Expander">
			<Setter Property="HorizontalContentAlignment" Value="Right"/>
			<Setter Property="VerticalContentAlignment" Value="Center"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="tc:Expander">
						<Grid>
							<Grid.Resources>

								<ControlTemplate x:Key="ExpanderDownHeaderTemplate" TargetType="ToggleButton">
									<Grid x:Name="buttonRoot" Background="Transparent" RenderTransformOrigin="0.5,0.5">
										<Grid.RenderTransform>
											<CompositeTransform/>
										</Grid.RenderTransform>
										<VisualStateManager.VisualStateGroups>
											<VisualStateGroup x:Name="CheckStates">
												<VisualStateGroup.Transitions>
													<VisualTransition GeneratedDuration="00:00:00"/>
												</VisualStateGroup.Transitions>
												<VisualState x:Name="Checked"/>
												<VisualState x:Name="Unchecked"/>
											</VisualStateGroup>
											<VisualStateGroup x:Name="CommonStates">
												<VisualStateGroup.Transitions>
													<VisualTransition GeneratedDuration="0"/>
													<VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver"/>
													<VisualTransition GeneratedDuration="00:00:00.1" To="Pressed"/>
												</VisualStateGroup.Transitions>
												<VisualState x:Name="Normal"/>
												<VisualState x:Name="MouseOver"/>
												<VisualState x:Name="Pressed">
													<Storyboard>
														<DoubleAnimation Duration="0" To="0.85" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="buttonRoot" d:IsOptimized="True"/>
														<DoubleAnimation Duration="0" To="0.8" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="buttonRoot" d:IsOptimized="True"/>
														<DoubleAnimation Duration="0" To="0.961" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="path" d:IsOptimized="True"/>
														<DoubleAnimation Duration="0" To="0.677" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="path" d:IsOptimized="True"/>
													</Storyboard>
												</VisualState>
											</VisualStateGroup>
											
										</VisualStateManager.VisualStateGroups>
										
										<Grid.ColumnDefinitions>
											<ColumnDefinition Width="Auto" />
											<ColumnDefinition Width="*" MinWidth="115" />
										</Grid.ColumnDefinitions>
                    <Path x:Name="path" Data="M35,1 L35,35 L1,35 z" Fill="#74716b" Stroke="#74716b" StrokeThickness="2" UseLayoutRounding="False" RenderTransformOrigin="0.5,0.5" Height="35">
											<Path.RenderTransform>
												<CompositeTransform/>
											</Path.RenderTransform>
										</Path>
                    <Rectangle Grid.Column="1" Fill="#74716b" Height="35"  Stroke="#74716b" StrokeThickness="2" UseLayoutRounding="False" />
										<ContentPresenter Content="{TemplateBinding Content}" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,10,0" />
									</Grid>
								</ControlTemplate>
							
							
							</Grid.Resources>
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="ExpansionStates">
									<VisualStateGroup.Transitions>
										<VisualTransition GeneratedDuration="0"/>
									</VisualStateGroup.Transitions>
									<VisualState x:Name="Collapsed"/>
									<VisualState x:Name="Expanded">
										<Storyboard>
											<ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ExpandSite">
												<DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
											</ObjectAnimationUsingKeyFrames>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Popup.IsOpen)" Storyboard.TargetName="popup">
												<DiscreteObjectKeyFrame KeyTime="0">
													<DiscreteObjectKeyFrame.Value>
														<System:Boolean>True</System:Boolean>
													</DiscreteObjectKeyFrame.Value>
												</DiscreteObjectKeyFrame>
											</ObjectAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
								</VisualStateGroup>
								
							</VisualStateManager.VisualStateGroups>
							
							
								<Grid>
									<Grid.RowDefinitions>
										<RowDefinition x:Name="rd0" Height="Auto"/>
										<RowDefinition x:Name="rd1" Height="Auto"/>
									</Grid.RowDefinitions>
                  <ToggleButton x:Name="ExpanderButton" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" Cursor="Hand" Grid.Column="0" FontWeight="SemiBold" FontStyle="{TemplateBinding FontStyle}" FontStretch="{TemplateBinding FontStretch}" FontSize="17" FontFamily="{StaticResource DefaultFontFamily}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsChecked="{TemplateBinding IsExpanded}" Margin="1" MinWidth="0" MinHeight="0" Padding="{TemplateBinding Padding}" Grid.Row="0" Template="{StaticResource ExpanderDownHeaderTemplate}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Foreground="#FF4B5657"/>
									<Popup x:Name="popup" IsOpen="False" Grid.Row="1"  Width="150" HorizontalAlignment="Left">
                    <Grid Background="#44111111" MinWidth="150">
											<ContentControl x:Name="ExpandSite" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}"  FontSize="16" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}"  VerticalAlignment="{TemplateBinding VerticalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
										</Grid>
									</Popup>
								</Grid>
						
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	
	</UserControl.Resources>
    
   <StackPanel Orientation="Horizontal" x:Name="LayoutRoot" Height="35" >
    <Image Source="/ScrumBoard;component/Resources/SearchIcon.png" Height="22" Cursor="Hand" Margin="0,0,7,0" MouseLeftButtonDown="Image_MouseLeftButtonDown" />
    
		<Grid Width="230" Margin="0,0,-27,0">
      <Path Data="M1,1 L229,1 L195,34 L1,34 z" Fill="#44111111" Stretch="Fill" Stroke="#74716b" StrokeThickness="2" UseLayoutRounding="False" Height="35"/>
			<TextBox Name="tbxSearch" IsTabStop="True" Text="search" FontSize="16" VerticalContentAlignment="Center" Padding="10,4,2,2" BorderThickness="0" Background="Transparent" Margin="2,2,35,2" GotFocus="tbxSearch_GotFocus" />
		</Grid>
    <!---->
    <tc:Expander Header="{Binding CurrentUser}" Style="{StaticResource ExpanderStyle1}">
    	<tc:Expander.Content>
    		<StackPanel Margin="10">
          <HyperlinkButton FontSize="14" Content="Settings" NavigateUri="/TestPage" HorizontalContentAlignment="Right" Foreground="Black"  Margin="0,10,0,0" />
          <HyperlinkButton FontSize="14" Content="Sing out" NavigateUri="/Welcome" HorizontalContentAlignment="Right"  Foreground="Black"  Margin="0,10,0,0" />
        </StackPanel> 	
			</tc:Expander.Content>  
		</tc:Expander>
  </StackPanel>
</UserControl>
